﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="list_products.aspx.cs" Inherits="RastinArgham.CRM.Web.list_products" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h3 class="ui-widget-header">
            <asp:Literal ID="lbtitle" runat="server" Text="تعریف کالا" />
    </h3>

    <div class="ui-layout-content ui-widget-content">
        <mani:PagingGridView runat="server" ID="gvProducts" 
            AutoGenerateColumns="false" GridLines="none" DataKeyNames="ProductId" 
            onselectedindexchanging="gvProducts_SelectedIndexChanging">

            <Columns>
                <asp:BoundField HeaderText="کد" DataField="ProductId" />
                <asp:BoundField HeaderText="نام کالا" DataField="ProductName" />
                <asp:TemplateField HeaderText="قیمت">
                    <ItemTemplate>
                        <%# Mani.Common.UIHelper.FormatString(Eval("Price")) %>
                        ریال
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField HeaderText="درصد مالیات" DataField="TaxPercent" />
                <asp:CheckBoxField HeaderText="فعال" DataField="Enable" />

                <asp:TemplateField HeaderText="ویرایش">
                    <itemtemplate>
                        <asp:LinkButton ID="btnEdit" runat="server" CausesValidation="False" CommandName="Select">
                                <img src="/App_Themes/<%=Page.Theme %>/images/edit.gif" alt="" style="border:0;" />
                        </asp:LinkButton>
                    </itemtemplate>
                </asp:TemplateField>
            </Columns>
        </mani:PagingGridView>

         <div class="space2"></div>

         <h3>ایجاد و ویرایش کالا</h3>

         <table>
            <tr>
                <td>کد کالا</td>
                <td>
                    <asp:TextBox ID="txtId" runat="server" ReadOnly="true" />
                </td>
            </tr>
            <tr>
                <td colspan="2">&nbsp;</td>
            </tr>
            <tr>
                <td>نام کالا</td>
                <td>
                    <asp:TextBox ID="txtProductName" runat="server" Width="200" />
                </td>
            </tr>
            <tr>
                <td colspan="2">&nbsp;</td>
            </tr>
            <tr>
                <td>توضیحات</td>
                <td>
                    <asp:TextBox ID="txtDescription" runat="server" TextMode="MultiLine" Width="250" Height="150" />
                </td>
            </tr>
            <tr>
                <td colspan="2">&nbsp;</td>
            </tr>
            <tr>
                <td>قیمت</td>
                <td>
                    <asp:TextBox ID="txtPrice" runat="server" />
                    ریال
                </td>
            </tr>
            <tr>
                <td colspan="2">&nbsp;</td>
            </tr>
            <tr>
                <td>درصد مالیات</td>
                <td>
                    <asp:Textbox ID="txtTaxPercent" runat="server" />
                </td>
            </tr>
             <tr>
                <td colspan="2">&nbsp;</td>
            </tr>
            <tr>
                <td>استان</td>
                <td>
                    <asp:DropDownList ID="ddlProvinces" runat="server"
                                        DataTextField="ProvinceName" DataValueField="ProvinceId" 
                                        AppendDataBoundItems="true">
                            <asp:ListItem Text="---" Value="-1" />
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td colspan="2">&nbsp;</td>
            </tr>
            <tr>
                <td>فعال</td>
                <td>
                    <asp:CheckBox ID="cbEnable" runat="server" />
                </td>
            </tr>
            <tr>
                <td colspan="2">&nbsp;</td>
            </tr>
            <tr>
              <td colspan="2">
                <asp:Button ID="btnSaveChanges" Text="ذخیره تغییرات" runat="server" onclick="btnSaveChanges_Click" />
              </td>
            </tr>
         </table>
    </div>
</asp:Content>
